The present invention relates generally to the field of computer modeling, and more particularly to modeling and managing representational state transfer application programming interfaces.
REST (representational state transfer) is an architectural style consisting of a coordinated set of constraints, within a distributed hypermedia system, applied to: (i) components; (ii) connectors; and/or (iii) data elements. REST ignores protocol syntax and the details of component implementation in order to focus on: (i) the roles of components; (ii) interaction constraints with other components; and/or (iii) interpretation of significant data elements. REST has been applied to: (i) describing desired web architecture; (ii) identifying existing problems; (iii) comparing alternative solutions; and/or (iv) ensuring that protocol extensions would not violate core constraints that make a successful world wide web.
An object graph is a view of an object system at a particular point in time. A normal data model such as a UML (unified modeling language) class diagram details the relationships between classes, but an object graph, on the other hand, relates their instances. An object-oriented application typically contains a complex web of interrelated objects, and these objects are linked to each other by: (i) one object owning another object; (ii) one object containing another object; and/or (iii) one object holding a reference to another object. This web of objects is called an object graph. An object graph is a relatively abstract structure that can be used in discussing an application's state. An object graph is a directed graph. An object graph is a non-cyclic graph, but allows for random access. Because it is random access this means that someone navigating a parent can go to its children, and its children can go back to its parent when stored in volatile memory, objects occupy different segments of the memory with their attributes and function table, while relationships are represented by pointers or a different type of global handler in higher-level languages.
More and more companies are exposing HTTP (hypertext transfer protocol) endpoints that can be used for performing certain services, requesting data, etc. A single endpoint is a single part of a web/REST application (which in turn can belong to a set of applications). Therefore, an application is constituted by a set of endpoints, and (ii) each endpoint may be described as a portion of a REST application. In theory, these endpoints follow the REST (representational state transfer) pattern where: (i) there is an HTTP verb (GET, POST, DELETE, etc.) that describes the action; (ii) a resource name in the URL (uniform resource locator) describing which resource to apply the action to; and (iii) (optionally) a payload representing a new or updated resource. An example of code (including all three parts (i), (ii) and (iii)) corresponding to an example HTTP endpoint is as follows: “PUT http://host:port/myBank/employees/bob” with a JSON payload “{‘telephone’: ‘123-45678’}”, where: (i) the HTTP verb in the example is “PUT”, which indicates the action to update the resource; (ii) the resource name in the URL is “bob”, because that is identifying the specific resource being worked with; and (iii) the payload that will be updated is {‘telephone’: ‘123-45678’}”.
However, in reality, today's systems are much more complicated than this simple notion. Each URL contains many optional, or required, query parameters. The URLs may require: (i) special headers; (ii) specifically structured payloads; and/or (iii) different security models. An example of setting a special header in pseudo code is as follows:
URL url = new URL(“https://host:port/myApp/weather”);HttpsURLConnection connection = url.openConnection( );connection.addRequestProperty(“specialHeader1”, “myValue”);connection.addRequestProperty(“specialHeader2”, “myValue”);
An example of code to provide extra security models set on the connection:
connection.setRequestProperty(“Authorization”, “Basic abcbob”);connection.setHostnameVerifier(allowAll);connection.setSSLSocketFactory(myFactory);
A specifically structure payload would be a payload that must follow a certain pattern to be accepted, for example, some conventional payloads must have some elements, while other elements are optional as shown in the following example code:
{“name” : String // required“address” : String //required“age” : int //optional}